package com.ruoyi.passenger.notice.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.management.basics.vo.GetBannerListVo;
import com.ruoyi.management.mock.service.ITNoticeService;
import com.ruoyi.management.mock.vo.GetNoticeByIdVo;
import com.ruoyi.passenger.notice.ro.GetHnoticeListParam;
import com.ruoyi.passenger.notice.ro.GetHnoticeParam;
import com.ruoyi.passenger.notice.vo.GetNoticeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 驾驶员信息
 * 
 * @author ruoyi
 */
@RestController
@Api(tags = "乘客端--公告管理")
@RequestMapping("/passenger")
public class NoticeController extends BaseController
{
    @Resource
    private ITNoticeService tNoticeService;
    /**
     * banner查询 -乘客端
     */
    @ApiOperation(value = " banner查询 -乘客端", notes = "banner查询 -乘客端")
    @GetMapping("/select_banner_list")
    public TableDataInfo<List<GetBannerListVo>> getBannerList() {
        List<GetBannerListVo> list = tNoticeService.selectBannerList();
        return getDataTable(list);
    }

    /**
     * 公告查询 带分页-乘客端
     */
    @ApiOperation(value = "  公告查询 带分页 -乘客端", notes = " 公告查询 带分页 -乘客端")
    @GetMapping("/select_notice_list")
    public TableDataInfo<List<GetNoticeByIdVo>> selectNoticeList(@Valid GetHnoticeListParam param) {
        startPage();
        List<GetNoticeByIdVo> list = tNoticeService.selectNoticeList(param);
        return getDataTable(list);
    }

    /**
     * 公告详情
     */
    @ApiOperation(value = "公告详情", notes = "公告详情")
    @GetMapping("/select_notice_by_id")
    public AjaxResult selectNoticeById(@Valid GetHnoticeParam param) {
        return AjaxResult.success(tNoticeService.selectNoticeById(param));
    }

}
